import { EventMap } from '../module/event'

export const isMouseEvent = (type: keyof EventMap, event: EventMap[keyof EventMap]): event is MouseEvent => {
  return (['click', 'mousedown', 'mousemove', 'mouseup'] as (keyof EventMap)[]).includes(type)
}

export const isKeyboardEvent = (type: keyof EventMap, event: EventMap[keyof EventMap]): event is KeyboardEvent => {
  return (['keydown'] as (keyof EventMap)[]).includes(type)
}
